/**
Company: Sarkar software technologys
WebSite: http://www.sarkar.cn
Author: yeganaaa
Date : 5/16/18
Time: 5:57 PM
 */

package Cn.Sarkar.IMS.Entities

import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.IMS.IIMSApplicationDomain
import Cn.Sarkar.Entities.IMS.IProduct
import Cn.Sarkar.Entities.IMS.IProductComposition
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.IMS.DataBaseDefinations.ProductCompositions

class ProductComposition(DataContext: IDataContext) : IProductComposition, BaseEntity(DataContext, ProductCompositions) {
    var applicatiopnDomainId by ProductCompositions.ApplicationDomainID
    override var applicationDomain: IIMSApplicationDomain by hasOne(ProductCompositions.ApplicationDomainID) { IMSApplicationDomain(it) }
    var productID by ProductCompositions.ProductID
    override var product: IProduct by hasOne(ProductCompositions.ProductID) { Product(it) }
    override var number: Float by ProductCompositions.Number
}